<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>定位2</title>
    <style>
        #d0{
            border: #FF0000 2px solid;
            width: 300px;
            height: 300px;

        }
        #a1{
            display: block;
            background: blueviolet;
            width: 100px;
            height: 100px;
            color: white;
            float: left;
            line-height: 100px;
            text-align: center;
            text-decoration: none;
        }
        #a2{
            display: block;
            background: blueviolet;
            width: 100px;
            height: 100px;
            color: white;
            float: left;
            line-height: 100px;
            text-align: center;
            position: relative;
            left: 100px;
            text-decoration: none;
        }
        #a3{
            display: block;
            background: blueviolet;
            width: 100px;
            height: 100px;
            color: white;
            float: left;
            line-height: 100px;
            text-align: center;
            position: relative;
            top: 200px;
            left: -200px;
            text-decoration: none;
        }
        #a4{
            display: block;
            background: blueviolet;
            width: 100px;
            height: 100px;
            color: white;
            float: left;
            line-height: 100px;
            text-align: center;
            position: relative;
            top: 100px;
            left: 200px;
            text-decoration: none;
        }
        #a5{
            display: block;
            background: blueviolet;
            width: 100px;
            height: 100px;
            color: white;
            float: left;
            line-height: 100px;
            text-align: center;
            text-decoration: none;
        }
        #a1:hover,#a2:hover,#a3:hover,#a4:hover,#a5:hover{
            background: #1F87CC;
        }
    </style>
</head>
<body>
<div id="d0">
    <a id="a1" href="#">链接1</a>
    <a id="a2" href="#">链接2</a>
    <a id="a3" href="#">链接3</a>
    <a id="a4" href="#">链接4</a>
    <a id="a5" href="#">链接5</a>
</div>
</body>
</html>